home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / videoTime.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.2 KB  |  64 lines  |  [TEXT/MPS ]

  1. (*
  2.     videoTime() -- Return the time of the frame the player is currently displaying.
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w videoTime.p
  7.  
  8.         link -m ENTRYPOINT -o HyperCommands -rt XFCN=8007 -sn Main=videoTime ∂
  9.             videoTime.p.o "{MPW}"Libraries:interface.o "{MPW}"PLibraries:PasLib.o
  10.  
  11.     Copyright © 1988 Apple Computer, Inc.
  12.  
  13.     2/88 - Initial coding by Harry R. Chesley.
  14. *)
  15.  
  16. {$R-}
  17.  
  18. {$S videoTime }     { Segment name must be the same as the command name. }
  19.  
  20. unit DummyUnit;
  21.  
  22. interface
  23.  
  24. uses MemTypes, QuickDraw, OSIntf, ToolIntf, HyperXCmd;
  25.  
  26. procedure EntryPoint(paramPtr: XCmdPtr);
  27.     
  28. implementation
  29.  
  30. type
  31.  
  32. Str31 = String[31];
  33.  
  34. procedure videoTime(paramPtr: XCmdPtr); forward;
  35.  
  36. procedure EntryPoint(paramPtr: XCmdPtr);
  37.  
  38.     begin
  39.         videoTime(paramPtr);
  40.     end;
  41.  
  42. procedure videoTime(paramPtr: XCmdPtr);
  43.  
  44.     {$I XCmdGlue.inc}
  45.  
  46.     procedure Fail(errMsg: Str255); { set theResult and quit }
  47.         begin
  48.             paramPtr^.returnValue := PasToZero(errMsg);
  49.             exit(videoTime);
  50.         end;
  51.  
  52.     {$I VideoUtil.inc}
  53.  
  54.     begin
  55.         if paramPtr^.paramCount <> 0 then Fail('parameter count is not 0');
  56.  
  57.         { Clear out any pending input. }
  58.         EvalAndDispose('recvUpTo(empty,0,empty)');
  59.  
  60.         paramPtr^.returnValue := PasToZero(videoFunc('time',''))
  61.     end;
  62.  
  63. end.
  64.